package model.semantics;

import java.util.List;

import model.State;
import model.TurtleState;

public class QuaternaryOperation extends Operation<Integer> {

    public QuaternaryOperation(String label) {
        super(4, label);
    }

    @Override
    protected Integer evaluateSafely(State<Integer> state, List<Integer> values) {
        return evaluateValue((TurtleState) state, values.get(0), values.get(1),
                values.get(2), values.get(3));
    }

    /**
     * Given a value, transform it into a new value.
     * 
     */
    protected Integer evaluateValue(TurtleState state, Integer value1,
            Integer value2, Integer value3, Integer value4) {
        return state.runCommand(myLabel.trim(), value1, value2, value3, value4);
    }
}
